fix a leak when using shortnames and no output.
authortsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 14 Feb 2014 03:09:00 +0000 (03:09 +0000)
committertsteven4@gmail.com <tsteven4@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 14 Feb 2014 03:09:00 +0000 (03:09 +0000)
git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4739 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/waypt.cc

index 3abaceb048eb2e3367fc076799f7a4b6aabd59cb..27385e3e09aba913953a562428809e383dff0fad 100644 (file)
@@ -180,15 +180,11 @@ waypt_disp(const Waypoint* wpt)
 #else
   if (wpt->description) {
 #endif
-    char* tmpdesc = xstrdup(wpt->description);
     printf("%s/%s",
            global_opts.synthesize_shortnames ?
-           mkshort(mkshort_handle, tmpdesc) :
-           CSTRc(wpt->shortname),
-           tmpdesc);
-    if (tmpdesc) {
-      xfree(tmpdesc);
-    }
+           qPrintable(mkshort(mkshort_handle, wpt->description)) :
+           qPrintable(wpt->shortname),
+           qPrintable(wpt->description));
   }
 
   if (wpt->altitude != unknown_alt) {